package com.candy.control;

import com.candy.bean.UserInfo;
import com.candy.service.UserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class UserInfoController {
    @Autowired
    UserInfoService userInfoService;

    @RequestMapping("/getUserInfoes")
    public List<UserInfo> getUserInfoes(UserInfo userInfo){
        return userInfoService.getUserInfoes(userInfo);

    }

    @RequestMapping("/editUserInfo")
    public String editUserInfo(UserInfo userInfo){
        boolean ok=userInfoService.editUserInfo(userInfo);
        if(ok){
            return "ok";
        }else {
            return "eg";
        }
    }



}
